#ifndef __ADAPT_H__
#define __ADAPT_H__
#include <iostream>
#include <string>
#include <memory>

class TypeCCharge{
public:
    void charge(){
        std::cout << "Type C charge." << std::endl;
    }
};



class USBCharge{
public:
    virtual void charge() = 0;

};

class Adapter : public USBCharge{
public:
    Adapter(TypeCCharge* charger):m_typec_charge(charger){}
    virtual void charge(){
        std::cout << "use adapter charge." << std::endl;
        m_typec_charge->charge();
    }
private:
    std::shared_ptr<TypeCCharge> m_typec_charge;

};

class Computer{
public:
    void setCharge(USBCharge* charger){
        m_usb_charge = std::shared_ptr<USBCharge>(charger);
    }
    void charged(){
        std::cout << "use usb charge." << std::endl;
        m_usb_charge->charge();
    }


private:
    std::shared_ptr<USBCharge> m_usb_charge;
};



#endif